﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using ZhimeiSoft.CharmManager.DOL;
using ZhimeiSoft.CharmManager.Server.Factory;
using ZhimeiSoft.CharmManager.Server.BLL.Interface;
using ZhimeiSoft.CharmManager.Server.DAL.Interface;

namespace ZhimeiSoft.CharmManager.Server.BLL
{
    public class ScheduleBLL : IScheduleBLL
    {
        IScheduleDAL scheduleDAL;

        public ScheduleBLL()
        {
            scheduleDAL = BaseDalFactory.CreateScheuleDal();
        }

        #region IScheuleBLL 成员

        public void InsertScheduleCustom(DBEntitySchedule scheduleInfo, DBEntityScheduleCustom scheduleCustom)
        {
            scheduleDAL.InsertScheduleCustom(scheduleInfo, scheduleCustom);
        }

        public void DeleteScheduleCustom(DBEntitySchedule scheduleInfo, DBEntityScheduleCustom scheduleCustom)
        {
            scheduleDAL.DeleteScheduleCustom(scheduleInfo, scheduleCustom);
        }

        public void UpdateScheduleCustom(DBEntitySchedule scheduleInfo, DBEntityScheduleCustom scheduleCustomOld,
            DBEntityScheduleCustom scheduleCustomNew)
        {
            scheduleDAL.UpdateScheduleCustom(scheduleInfo, scheduleCustomOld, scheduleCustomNew);
        }

        public DataSet QueryScheduleState(string scheduleState)
        {
            return scheduleDAL.QueryScheduleState(scheduleState);
        }

        /// <summary>
        /// 根据用户ID获取提醒信息
        /// </summary>
        /// <param name="customerID">用户ID</param>
        /// <param name="scheduleState">提醒状态</param>
        /// <returns></returns>
        public DataSet QueryScheduleCustomID(int customerID, string scheduleState)
        {
            return scheduleDAL.QueryScheduleCustomID(customerID, scheduleState);
        }
        /// <summary>
        /// 根据用户ID以及当前时间查询提醒信息.
        /// </summary>
        /// <param name="customerID">用户ID</param>
        /// <param name="currTime">当前时间</param>
        /// <returns>返回提醒数据集</returns>
        public DataSet QueryScheduleCustomDateTime(int customerID, DateTime currTime)
        {
            return scheduleDAL.QueryScheduleCustomDateTime(customerID, currTime);
        }
        /// <summary>
        /// 根据月份查询预约记录
        /// </summary>
        /// <param name="queryYear">查询年</param>
        /// <param name="queryMonth">查询月</param>
        /// <returns></returns>
        public DataSet QueryScheduleMonth(int queryYear, int queryMonth)
        {
            return scheduleDAL.QueryScheduleMonth(queryYear, queryMonth);
        }
        /// <summary>
        /// 根据日查询预约记录
        /// </summary>
        /// <param name="queryYear">年</param>
        /// <param name="queryMonth">月</param>
        /// <param name="queryDay">日</param>
        /// <returns></returns>
        public DataSet QueryScheduleDay(int queryYear, int queryMonth, int queryDay)
        {
            return scheduleDAL.QueryScheduleDay(queryYear, queryMonth, queryDay);
        }
        #endregion
    }
}
